package co.edu.udistrital.analyzer.business.orm.model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.Length;

import co.edu.udistrital.analyzer.business.orm.model.enums.Profile;

@Entity
@Table(name="usuarios")
@NamedQueries({
	@NamedQuery(name="findUsuarioByLogin", query="select u from User u where u.login = :login")})
public class User implements Serializable {

	/**
	 * The serial version
	 */
	private static final long serialVersionUID = -1319576106641048401L;

	/**
	 * The user id
	 */
    @Id
    @Column(name="id_usuario", precision=18, scale=0)
	private Long id;
	
	/**
	 * The user profile
	 */
    @NotNull
    @Length(max=50)
    @Enumerated(EnumType.STRING)
    @Column(name="perfil", length=50, nullable= false)
	private Profile profile;
	
	/**
	 * The key for this param
	 */
    @NotNull
    @Length(max=255)
    @Column(name="login", length=255, nullable= false)
	private String login;
	
	/**
	 * The value for this param
	 */
    @NotNull
    @Length(max=255)
    @Column(name="clave", length=255, nullable= false)
	private String password;

	/**
	 * @return Retorna el valor de id
	 */
	public Long getId() {
		return id;
	}

	/**
	 * @return Retorna el valor de profile
	 */
	public Profile getProfile() {
		return profile;
	}

	/**
	 * @return Retorna el valor de login
	 */
	public String getLogin() {
		return login;
	}

	/**
	 * @return Retorna el valor de password
	 */
	public String getPassword() {
		return password;
	}

	/**
	 * Asigna un nuevo valor aid
	 * 
	 * @param id Nuevo valor de id
	 */
	public void setId(Long id) {
		this.id = id;
	}

	/**
	 * Asigna un nuevo valor aprofile
	 * 
	 * @param profile Nuevo valor de profile
	 */
	public void setProfile(Profile profile) {
		this.profile = profile;
	}

	/**
	 * Asigna un nuevo valor alogin
	 * 
	 * @param login Nuevo valor de login
	 */
	public void setLogin(String login) {
		this.login = login;
	}

	/**
	 * Asigna un nuevo valor apassword
	 * 
	 * @param password Nuevo valor de password
	 */
	public void setPassword(String password) {
		this.password = password;
	}

}
